package lab02.test32;

import java.util.HashMap;
import java.util.Map;

public class Test {
       public static void main(String[] args) {

       //Map
       //entry
        /*key value*/

       Map<String,String> map = new HashMap<String, String>();
       //添加元素
       map.put("id","1");
       map.put("name","张三");
       map.put("gender","男");
       map.put("age","25");
       map.put("love","爱学Java");


       //遍历map
       for (Map.Entry<String,String> entry :map.entrySet()){
           System.out.println(entry.getKey()+":"+entry.getValue());
       }

       //打印集合的大小
       System.out.println("删除之前集合的大小："+map.size());

       System.out.println("删除的元素内容是："+map.get("age"));

       map.remove("age");

       System.out.println("删除后的集合大小是："+map.size());

   }
}

